package project02.controller.message;

import java.util.logging.Logger;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import project02.dao.MessageDataDao;
import project02.model.MessageData;

public class ModifyController extends Controller {

    @SuppressWarnings("unused")
    private static final Logger logger = Logger.getLogger(ModifyController.class.getName());

    @Override
    public Navigation run() {
        MessageDataDao dao = new MessageDataDao();
        MessageData entity = new MessageData();
        try {
            entity = dao.find(asString("dataId"));

        } catch (Exception e) {
            requestScope("test", e.getMessage());
        }

        requestScope("resultData", entity);

        return forward("modify.jsp");
    }
}
